package cn.gz.ibix.library.http;

import java.util.Map;

import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 项目名称：QiYiChuAPP
 * <br>类描述：
 * <br>创建人：htliu
 * <br>创建时间：2018/3/24 11:24
 * <br>修改人:
 * <br>修改时间：2018/3/24 11:24
 * <br>修改备注：
 * <br>@version
 */
@Data
@Accessors(fluent = true)
public class RequestParam<T> {
    private Method method = Method.GET;
    private String api;
    /**
     * url参数
     */
    private Map<String, String> params;
    /**
     * form表单参数
     */
    private Map<String, String> forms;
    private Map<String, String> headers;
    private Object body;
    private BodyType bodyType = BodyType.JSON;
    private UploadType uploadType;
    private IConvertResponse<T> iConvertResponse;

    public enum Method {
        GET, POST, DELETE, PUT
    }

    /**
     * 暂时只支持json
     */
    public enum BodyType {
        JSON
    }

    /**
     * 上传类型
     */
    public enum UploadType {
        FILE, FORM, BODY
    }

}
